<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateHousesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('houses', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 50);
            $table->string('cover', 255);
            $table->longText('content');
            $table->integer('item_id')->unsigned()->default(0);
            $table->integer('channel_id')->unsigned()->default(0);
            $table->integer('read_num')->unsigned()->default(0);
            $table->unsignedTinyInteger('country')->default(0);
            $table->integer('state_id')->default(0);
            $table->string('state', 64);
            $table->string('state_name', 64);
            $table->integer('county_id')->default(0);
            $table->string('county', 64);
            $table->string('county_name', 64);
            $table->integer('zip_id')->default(0);
            $table->string('zip_code', 16);
            $table->string('zip', 64);
            $table->string('zip_name', 64);
            $table->string('address', 100);
            $table->integer('status')->nullable()->default(1);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('houses');
    }
}
